package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.domain.Activity;
import com.ruoyi.system.api.domain.Article;
import com.ruoyi.system.api.domain.ArticleResponseVo;
import com.ruoyi.system.api.domain.Tribe;
import com.ruoyi.system.api.factory.RemoteSearchFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "remoteSearchService",value = ServiceNameConstants.SEARCH_SERVICE,fallbackFactory = RemoteSearchFallbackFactory.class)
public interface RemoteSearchService {

    @PostMapping("/activity/update")
    public AjaxResult update(@RequestBody Activity activity, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);

    @PostMapping("/activity/insert")
    public AjaxResult insert(@RequestBody Activity activity, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);

    @PostMapping("/blob/add")
    public AjaxResult add(@RequestBody Article article, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);


    @PostMapping("/blob/update")
    public R<ArticleResponseVo> update(@RequestBody ArticleResponseVo articleResponseVo, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);

    @PostMapping("/tribe/insert")
    public R<Tribe> insert(@RequestBody Tribe tribe, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);

    @PostMapping("/tribe/update")
    public R<Tribe> update(@RequestBody Tribe tribe, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);
}
